<template>
  <div class="home">
   首页
    <el-carousel height="150px">
      <el-carousel-item v-for="item in banner_list" :key="item.targetId">
        <img ref="imgHeight" :src="item.imageUrl" width="100%" height="100%" object-fit="cover">
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>
import { getBanner} from '@/api/index'
export default {
  name: 'Home',
  data () {
    return {
      banner_list: []
    }
  },
  mounted(){
    getBanner().then(res=>{
      console.log(res)
      this.banner_list = res.banners.slice(0,4)
    })
  }
}
</script>


<style scoped>

</style>
